package day02_Thread.demo_buyTicket_extends_Thread;

public class ThreadYouXIanJi extends Thread{
    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName()+"---");
    }

    public static void main(String[] args) {
        ThreadYouXIanJi t1= new ThreadYouXIanJi();
        ThreadYouXIanJi t2= new ThreadYouXIanJi();
        ThreadYouXIanJi t3= new ThreadYouXIanJi();

//        设置线程的优先级
        t1.setPriority(Thread.MIN_PRIORITY);//最小优先级
        t2.setPriority(Thread.MAX_PRIORITY);//
        t3.setPriority(Thread.NORM_PRIORITY);

        t1.start();
        t2.start();
        t3.start();

        System.out.println("t1---"+t1.getPriority());
        System.out.println("t2---"+t2.getPriority());
        System.out.println("t3---"+t3.getPriority());
        System.out.println("main---"+Thread.currentThread().getPriority());
    }
}
